package com.springboot.cloud.product.controller;

import com.springboot.cloud.core.annotation.SystemLog;
import com.springboot.cloud.core.vo.Product;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>  </p>
 *
 * @author Bertram
 * @since 11/4/2019 10:16 AM
 */

@RestController
@RequestMapping("/product")
@Api("ProductController")
public class ProductController {

    @ApiOperation(value = "获取商品通过商品id", notes = "获取商品通过商品id")
    @ApiImplicitParam(name = "productId", value = "商品唯一标识", required = true, dataType = "Integer")
    @SystemLog(serviceId = "product-service", moduleName = "service-product", actionName = "获取商品根据id")
    @GetMapping(value = "/getProductById")
    public Product getProductByProductId (@RequestParam(value = "productId") Integer productId) {
        Product product= new Product();
        product.setProductId(productId);
        product.setProductName("商品测试");
        return product;
    }
}
